<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>专家登录</title>
    <!-- Bootstrap -->
    <link href="jsp/common/css/bootstrap.min.css" rel="stylesheet">
    <link href="jsp/common/css/font-awesome.min.css" rel="stylesheet">
    <link href="jsp/common/css/bootstrap-extend.css" rel="stylesheet">
    <script src="jsp/common/js/jquery.min.js"></script>
    <script src="jsp/common/js/bootstrap.min.js"></script>
    <script src="jsp/common/js/angular.min.js"></script>
    <script src="jsp/common/js/module/ajaxModule.js"></script>
    <script src="jsp/common/js/angular-md5.min.js"></script>
    <script>
        var m = angular.module("m", ["ajaxModule", "angular-md5"]);
        var c = m.controller("c", function ($scope, ajax, md5) {
            $scope.username = "";
            $scope.phone = "";
            $scope.password = "";
            $scope.code = "";
            $scope.type = 2;
            $scope.typeTo = function (type) {
                $scope.type = type;
            }
            $scope.customer = {android: {}, ios: {}};
            $scope.expert = {android: {}, ios: {}};
            ajax.ajax("/server/UpgradeCtrl/getLastedVersion", "POST", {
                upgradeType: 2,
                platform: 0
            }).success(function (data) {
                $scope.customer.android = data.value;
                $scope.customer.android.filePath = $scope.customer.android.file.path;
                $scope.customer.android.version = "v" + $scope.customer.android.version;
            });
            ajax.ajax("/server/UpgradeCtrl/getLastedVersion", "POST", {
                upgradeType: 4,
                platform: 0
            }).success(function (data) {
                $scope.expert.android = data.value;
                $scope.expert.android.filePath = $scope.expert.android.file.path;
                $scope.expert.android.version = "v" + $scope.expert.android.version;
            });
            $scope.customer.ios.path = "https://itunes.apple.com/cn/app/chang-e-kang-shuai-nin-shen/id1141765442?l=en&mt=8";
            $scope.expert.ios.path = "https://itunes.apple.com/cn/app/chang-e-kang-shuai-zhuan-jia/id1114707128?l=en&mt=8";
            $scope.login = function () {
                ajax.ajax("/server/login/loginAdmin", "POST", {
                    "username": $scope.username,
                    "password": md5.createHash($scope.password)
                }).success(function (data) {
                    if (data.success) {
                        var moduleJson = eval("(" + data.value.moduleJson + ")");
                        if (moduleJson[0].subs.length > 0) {
                            window.location.href = moduleJson[0].subs[0].url;
                        } else {
                            window.location.href = moduleJson[0].url;
                        }
                    } else {
                        $scope.e = true;
                    }
                });
            };
            $scope.expertLogin = function () {
                ajax.ajax("/server/login/loginExpertWebIm", "POST", {
                    "phone": $scope.phone,
                    "code": $scope.code
                }).success(function (data) {
                    console.log(data);
                    if (data.success) {
                        window.location.href = "jsp/webIm/indexIm.jsp";
                    } else {
                        $scope.el = true;
                    }
                });
            };
            $scope.getCode = function () {
                console.log("getCode");
                ajax.ajax("/server/login/sendVerifyCodeToExpert", "POST", {
                    "phone": $scope.phone,
                }).success(function (data) {
                    if (data.success) {
                        alert("获取成功，请尽快登陆");
                    } else {
                        alert(data.message);
                    }
                });
            };
        });
    </script>
    <style>
        .bottom-line {
            position: relative;
        }

        .bottom-line:after {
            content: "";
            position: absolute;
            bottom: -15px;
            left: 20px;
            right: 20px;
            height: 2px;
            background-color: #EDB840;
        }

        .left-angle {
            position: relative;
        }

        .left-angle:after {
            content: '';
            position: absolute;
            left: -28px;
            width: 0;
            height: 0;
            top: 50%;
            margin-top: -20px;
            border-left: solid 30px transparent;
            border-right: solid 30px transparent;
            border-bottom: solid 40px #fff;
            z-index: -1;
        }

        .white-btn {
            padding-top: 25px;
            width: 280px;
            height: 100px;
            font-size: 30px;
            border-radius: 15px;
            border: solid 1px #ffffff;
            color: #ffffff;
            background-color: transparent;
            outline: none
        }

        .white-btn:hover, .white-btn:focus {
            background-color: rgba(255, 255, 255, 0.1);
            color: #ffffff;
        }

        .green-btn {
            padding-top: 25px;
            margin-top: 30px;
            width: 280px;
            height: 100px;
            font-size: 30px;
            border-radius: 15px;
            border: solid 1px #08c808;
            color: #08c808;
            background: transparent;
            outline: none
        }

        .green-btn:hover, .green-btn:focus {
            background-color: rgba(8, 200, 8, 0.1);
            color: #08c808;
        }

        .purple-btn {
            margin-top: 20px;
            width: 323px;
            height: 65px;
            font-size: 30px;
            border-radius: 15px;
            background-color: rgba(18, 29, 63, 0.5);
            color: #E7A700;
            outline: none;
            border: none;
        }

        .purple-btn:hover, .purple-btn:focus {
            background-color: rgba(18, 29, 63, 0.8);
            color: #EDB840;
        }
    </style>
</head>
<body ng-app="m"
      style='background: url("jsp/common/img/login_bg.png") repeat-y;background-size:100% auto;font-family: "黑体", "Helvetica Neue", Helvetica, Arial, sans-serif;font-weight: lighter;min-width: 1200px'>
<div style="padding:35px 120px;" ng-controller="c">
    <div>
        <img src="jsp/common/img/login_logo.png" style="height: 110px">
    </div>
    <div class="clearfix" style="margin-top: 50px">
        <div class="container" style="width: 793px;">
            <div style="margin-bottom: 33px;">
                <h2 class="m-y-0 text-white text-center">
                    <span style="color: #E7A700;font-size: 44px;">嫦娥抗衰专家登录平台</span>
                </h2>
            </div>
            <div style="background-color: rgba(255,255,255,0.2);border: solid 1px #fff;border-radius: 15px;padding: 20px 0 60px;">
                <!--专家登录-->
                <div class="">
                    <div class="clearfix center-block"
                         style="width:430px;border-radius: 15px;background-color: rgba(18,29,63,0.7);padding:25px;margin-top:50px ;position: relative">
                        <div class="pull-left">
                            <img src="jsp/common/img/login_1.png" style="height: 40px">
                        </div>
                        <div class="pull-left" style="height: 40px;width: 1px;background-color: #fff;margin: 0 25px"></div>
                        <div style="position: absolute;top:25px;left: 120px;right: 25px">
                            <input type="tel" ng-model="username" placeholder="请输入专家账号"
                                   style="outline: none;background-color: transparent;border: none;height: 40px;line-height: 40px;color: #fff;font-size: 25px;width: 100%;display: block">
                        </div>
                    </div>
                    <div class="clearfix center-block"
                         style="width:430px;border-radius: 15px;background-color: rgba(18,29,63,0.7);padding:25px;margin-top:20px ;position: relative">
                        <div class="pull-left">
                            <img src="jsp/common/img/login_2.png" style="height: 40px">
                        </div>
                        <div class="pull-left" style="height: 40px;width: 1px;background-color: #fff;margin: 0 25px"></div>
                        <div style="position: absolute;top:25px;left: 120px;right: 25px">
                            <input type="password" ng-model="password" placeholder="请输入密码"
                                   style="outline: none;background-color: transparent;border: none;height: 40px;line-height: 40px;color: #fff;font-size: 25px;width: 100%;display: block">
                        </div>
                    </div>
                    <div style="height: 1em;" class="m-y-md">
                        <p style="font-size: 20px;" class="text-danger m-y-0 text-center" ng-show="e">用户名或密码错误</p>
                    </div>
                    <button class="purple-btn center-block btn" ng-click="login()">登录</button>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>